package com.ccx.coachsite.bus;

import android.app.Activity;
import android.content.Context;

import com.ccx.coachsite.R;
import com.ccx.coachsite.http.HttpCallBack;
import com.ccx.coachsite.http.HttpRequest;
import com.ccx.coachsite.http.UrlConfig;
import com.ccx.coachsite.task.TaskBase;
import com.ccx.coachsite.task.TaskType;

public class SuggestBus extends BaseBus {

	public SuggestBus(Context mContext) {
		super(mContext);
		//super(activity, activity.getString(R.string.login_process));
		successInfo = "提交成功";
		errorInfo = "提交失败";
	}

	public void suggest(String mobile, String suggest) {
		showProgress();
		SuggestTask task = new SuggestTask(this, mContext);
		task.setParams(mobile, suggest);
		task.execute();
	}

	class SuggestTask extends TaskBase {

		public SuggestTask(HttpCallBack<?> iCall, Context context) {
			super(iCall, context);
			mTaskType = TaskType.TaskTypeLigin;
		}

		private String mobile;
		private String suggest;

		public void setParams(String mobile, String suggest) {
			this.mobile = mobile;
			this.suggest = suggest;
		}

		@Override
		protected String genUrl(HttpRequest request) {
			String baseUrl = UrlConfig.getUrlByKey(UrlConfig.SuggestUrlKey);
			baseUrl = baseUrl + "?phoneNum＝" + mobile + "&content=" + suggest;
			// Log.e(baseUrl);
			return baseUrl;
		}
	}
}
